import request from '../index'

/**
 * 获取我的后宫列表 {外站}
 * @param userId {string | number}
 * @returns {Promise}
 */
export function getFriendList(userId) {
  return request({
    url: '/friend/list',
    params: {
      userId
    }
  })
}

/**
 * 我关注的用户
 * @param userId {string | number}
 * @returns {Promise}
 */
export function getMineFollowList(userId) {
  return request({
    url: '/follow/mine/list',
    params: {
      userId
    }
  })
}

/**
 * 关注我的用户
 * @param userId {string | number}
 * @returns {Promise}
 */
export function getFollowMineList(userId) {
  return request({
    url: '/follow/other/list',
    params: {
      userId
    }
  })
}

/**
 * 关注一个用户
 * @param friendId {string | number}
 * @param nickname {string}
 * @returns {Promise}
 */
export function postFollowOne(friendId, nickname) {
  return request({
    url: '/follow',
    method: 'POST',
    data: {
      friendId,
      nickname
    }
  })
}

/**
 * 判断用户是否关注
 * @param friendId {string | number}
 * @returns {Promise}
 */
export function judgeFollow(friendId) {
  return request({
    url: '/follow/judge',
    params: {
      friendId
    }
  })
}

/**
 * 取消关注一个好友
 * @param friendId {string | number}
 * @returns {Promise}
 */
export function removeFollow(friendId) {
  return request({
    url: '/follow',
    method: 'DELETE',
    data: {
      friendId
    }
  })
}
